package com.powernode.ssm.springAnalysis.a01.event;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;

/**
 * 用来发布的事件
 */
@Component
@Slf4j
public class TestPublishEvent1 {
    @Autowired
    ApplicationEventPublisher publisher;

    public void publish(){
        log.info("测试打印发布注册事件");
        publisher.publishEvent(new TestEvent1(this));
    }

}
